Skip to content

feat(core,cli): M5 — plugins (manifest+hash) + Skill tool + CLI integration#6

Merged
oratis merged 1 commit into
mainfrom
feat/m5-plugins-skill-tool-integration
May 27, 2026
Merged

feat(core,cli): M5 — plugins (manifest+hash) + Skill tool + CLI integration#6
oratis merged 1 commit into
mainfrom
feat/m5-plugins-skill-tool-integration

Conversation

@oratis

@oratis oratis commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Plugin manifest + SHA-256 hash pinning + local install + discovery with drift detection.
  • Skill tool (makeSkillTool) so the agent can invoke skills by qualified name.
  • CLI REPL now wires memory + skills + output styles + mode/permission/hooks/approval into runAgent. Full end-to-end gating is live.
  • 258 tests passing / 0 failed (was 240).

Deliberately deferred to M5.1

Plugin code execution is deferred until the sandbox subprocess design (docs/design/plugin-security.md §3.5) lands. M5 ships discovery + trust + hash verification — running plugin code in-process without sandbox would be the RCE vector the security doc explicitly warned about.

Release notes

  • release-notes:feature

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…ntegration

What ships
----------
- plugins/manifest.ts (175 lines)
  · PluginManifest schema + readManifest()
  · SHA-256 source hash (manifest + all SKILL.md files) via computeSourceHash()
  · Trust state at ~/.deepcode/plugins-trust.json
  · installLocal() — copy + record trust + hash
  · discoverPlugins() — scan + verify hashes + return enabled list
  · Hash drift detection flags tampered plugins
  · disabled list honored

- skills/tool.ts (60 lines)
  · makeSkillTool(skills) factory — returns ToolHandler for "Skill"
  · Agent invokes by qualifiedName; returns body as tool_result
  · Supports plugin-prefixed names (plugin-x:do-thing)
  · Helpful error listing known skills when lookup fails

- apps/cli/src/repl.ts (+50 lines)
  · Loads memory (DEEPCODE.md hierarchy + AGENTS.md + rules/) via loadMemory()
  · Loads skills via loadSkills() with skillOverrides settings respected
  · Loads output styles, applies active style to system prompt
  · Registers Skill tool when any skills loaded
  · Builds composite system prompt: default + memory + skills block + style
  · Wires mode + permissions + hooks + approval into runAgent()
  · Approval prompts user [y]es/[n]o via readline when verdict is 'ask'

DELIBERATELY DEFERRED to M5.1 (security gate)
---------------------------------------------
Plugin code does NOT yet execute in the host process. discoverPlugins()
finds them and hash-verifies them; their contributed skills/agents/hooks/
MCP servers are NOT registered into live registries until sandbox subprocess
lands (per docs/design/plugin-security.md §3.5).

Running arbitrary plugin code in-process is the primary RCE vector enumerated
in the security doc. M5 ships the trust foundation; M5.1 ships the safe
execution boundary.

Tests
-----
- plugins/manifest.test.ts (12)  — manifest validation, hash determinism +
                                    sensitivity, trust round-trip, install,
                                    discover + drift, disabled, untrusted
- skills/tool.test.ts      ( 6)  — tool shape, lookup, args, plugin names,
                                    missing skill, missing arg

Total: 258 passed / 4 skipped / 0 failed (was 240).

Verified
--------
  pnpm typecheck    → green
  pnpm build        → green
  pnpm test         → 258 passed
  pnpm format:check → conformant
  CLI bin: --version, --help, doctor all work

Docs
----
- docs/milestones/M5.md — what shipped, what M5.1 needs, why the deferral

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit b70c0e1 into main May 27, 2026
@oratis oratis deleted the feat/m5-plugins-skill-tool-integration branch May 27, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant